import com.vhly.util.DeviceInfo;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import java.util.Vector;

final class cls_h
        implements inf_m {

    private MainThread mainThread;
    private cls_ab E;
    int a;
    int fld_b_int;
    int c;
    int d;
    int e;
    private int F;
    int f;
    int g;
    private int G;
    private int H;
    private int I;
    private int J;
    int h;
    int i;
    int j;
    private int K;
    int k;
    int l;
    int m;
    int n;
    private int L;
    private int M;
    private int N;
    private int O;
    int o;
    private int P;
    private int Q;
    private int R;
    private int S;
    private Image T;
    private long U;
    private long ai;
    private long aj;
    private long ak;
    boolean p;
    private boolean al;
    private boolean am;
    short fld_q_short;
    short r;
    short s;
    private short an;
    byte t[];
    int u[];
    short v[];
    String w[];
    String x[][];
    int y[];
    private int ao[];
    private int ap[];
    short z[][];
    short A[][];
    char B[][];
    private Image aq[];
    private cls_k ar[];
    cls_b C;
    private cls_b as;

    cls_h(MainThread thread, short word0, short word1) {
        short aword0[] = new short[0];
        a(thread, (short) 0, aword0, word0, word1, 5, -1);
    }

    cls_h(MainThread thread, short word0, short word1, short word2, int i1) {
        short aword0[] = new short[0];
        a(thread, word0, aword0, word1, word2, i1, -1);
    }

    cls_h(MainThread thread, short word0, short aword0[], short word1, short word2, int i1) {
        a(thread, word0, aword0, word1, word2, i1, -1);
    }

    cls_h(MainThread thread, short word0, short word1, short word2, short word3, int i1) {
        a(thread, word0, new short[]{word1}, word2, word3, i1, -1);
    }

    private void a(MainThread thread, short word0, short aword0[], short word1, short word2, int i1, int j1) {
        mainThread = thread;
        E = thread.L;
        s = word0;
        v = aword0;
        fld_b_int = i1;
        c = -1;
        int iword0 = v.length;
        z = new short[iword0][];
        y = new int[iword0];
        A = new short[0][];
        fld_q_short = word1;
        r = word2;

        if (i1 == 0 || i1 == 2 || i1 == 5 || i1 == 10) {
            C = thread.p;
            as = thread.fld_q_b;
        } else if (i1 == 6 || i1 == 7 || i1 == 4 || i1 == 9 || i1 == 1 || i1 == 3 || i1 == 8) {
            C = thread.u;
            as = thread.fld_v_b;
        }
        if (i1 == 7) {
            u = new int[iword0];
            t = new byte[iword0];
        }
        if (i1 == 6) {
            ap = new int[5];
            ao = new int[6];
            for (word1 = 0; word1 < 5; word1++)
                ap[word1] = 42 + word1 * 28;

            for (word1 = 0; word1 < 6; word1++)
                ao[word1] = 51 + word1 * 21;

            B = new char[6][];
            for (word1 = 0; word1 < 6; word1++) {
                B[word1] = new char[10];
                for (int iac1 = 0; iac1 < 10; iac1++)
                    B[word1][iac1] = '0';

            }

            I = -1;
            J = -1;
        } else if (i1 == 9) {
            int iac1 = 0;
            int[] iaword0 = new int[iword0];
            for (word1 = 0; word1 < iword0; word1++)
                if (v[word1] == 0 || v[word1] == -1)
                    iaword0[iac1++] = v[word1];

            B = new char[iac1][];
            for (word1 = 0; word1 < iac1; word1++)
                if (aword0[word1] == -1)
                    B[word1] = new char[64];
                else
                    B[word1] = new char[16];

            I = -1;
            J = 0;
        }
        k = 0xffffff;
        a(word0);
    }

    final void a(Graphics g1) {
        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        if (fld_b_int == 6 || fld_b_int == 9) {
            if (ai < MainThread.bP && I != -1) {
                e();
                ai = MainThread.bP + 2000L;
            }
            if (aj < MainThread.bP) {
                p = !p;
                aj = MainThread.bP + (long) (p ? 150 : '\u012C');
            }
        }
        if (u != null)
            if (ak < MainThread.bP) {
                am = true;
                ak = MainThread.bP + 100L;
            } else {
                am = false;
            }
        int i1 = o <= 0 ? R : R - P * g;
        if (fld_b_int != 10)
            b(g1);
        if (T != null && fld_b_int != 10) {
            int i4 = R - T.getHeight() - 6;
            g1.drawImage(T, 88, i4, 17);
            g1.setColor(0xf7f700);
            g1.drawRect(88 - (T.getWidth() >> 1) - 2, i4 - 1, T.getWidth() + 3, T.getHeight() + 1);
            g1.drawRect(88 - (T.getWidth() >> 1) - 1, i4 - 2, T.getWidth() + 1, T.getHeight() + 3);
        }
        switch (fld_b_int) {
            case 5:
            default:
                break;

            case 0:
            case 9:
                int i7 = 0;
                int j1  ;
                int i9 = C.e(cls_b.a(mainThread.strs[an]));
                j1 = DeviceInfo.DEVICE_SCREEN_HEIGHT - mainThread.img25.getHeight() - mainThread.img24.getHeight() - 3 - P * v.length;
                if (an != 0) {
                    String s9 = an == 0 ? null : mainThread.strs[an];
                    if (w != null)
                        s9 = MainThread.a(s9, w);
                    if (i9 > j1) {
                        g1.setClip(0, mainThread.img25.getHeight(), DeviceInfo.DEVICE_SCREEN_WIDTH, j1);
                        C.a(g1, cls_b.a(s9), 85, mainThread.img25.getHeight() - u[0], 17);
                        if (am)
                            if (t[0] > 0) {
                                if (--t[0] == 0 && u[0] != 0) {
                                    u[0] = 0;
                                    t[0] = 5;
                                }
                            } else {
                                u[0]++;
                            }
                        if (t[0] == 0 && i9 - u[0] < j1)
                            t[0] = 5;
                    } else {
                        C.a(g1, cls_b.a(s9), 88, R, 33);
                    }
                }
                g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                if (fld_b_int == 9) {
                    for (int k11 = 0; k11 < g; k11++)
                        if (v[k11] == 0 || v[k11] == -1)
                            i7++;

                }
                for (int l11 = g; l11 < g + O; l11++) {
                    int j4 = i1 + P * l11;
                    if (fld_b_int == 9 && (v[l11] == 0 || v[l11] == -1)) {
                        String s2 = "";
                        if (c == 15 || i7 == F)
                            g1.setColor(0xfffc00);
                        else
                            g1.setColor(0xffffff);
                        int i13 = 170;
                        int k14 = 3;
                        if (o > 0) {
                            i13 -= 13;
                            k14 += 6;
                        }
                        g1.fillRect(k14, j4 - 1, i13, P);
                        byte byte2 = ((byte) (v[l11] != 0 ? 64 : 16));
                        for (int i17 = 0; i17 < byte2; i17++)
                            if (B[i7][i17] != 0)
                                s2 = s2 + (new Character(B[i7][i17])).toString();

                        if (c == 16 && i7 == 1 || c == 17 && i7 == 1)
                            s2 = s2 + "@";
                        int j17;
//                        String s18;
                        if ((c != 16 || i7 != 2) && (c != 17 || i7 != 2) && c != 18) {
                            j17 = cls_b.c(s2.trim());
                        } else {
                            String s18 = s2.trim();
                            j17 = cls_b.d(s18);
                        }
                        boolean flag7 = false;
                        int k1 = 0;
//                        boolean flag4 = false;
                        int j9;
                        if (j17 > i13)
                            j9 = ((DeviceInfo.DEVICE_SCREEN_WIDTH - i13 >> 1) + i13) - j17;
                        else
                            j9 = DeviceInfo.DEVICE_SCREEN_WIDTH - j17 >> 1;
                        if (fld_b_int != 0 || c != 25)
                            g1.setClip(DeviceInfo.DEVICE_SCREEN_WIDTH - i13 >> 1, j4, i13, P);
                        else
                            g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                        j17 = C.a('@');
                        for (int j18 = 0; j18 < byte2; j18++) {
                            boolean flag5 = false;
                            if (!flag7 && j18 == 0 && (c == 16 && i7 == 1 || c == 17 && i7 == 1)) {
                                C.a(g1, "@", j9 + k1, j4, 20);
                                k1 += C.h[0][j17] + C.m;
                                flag7 = true;
                                j18--;
                                continue;
                            }
                            if (!p || j18 != h || i7 != F) {
                                j17 = B[i7][j18];
                                if ((c == 16 && i7 == 2 || c == 17 && i7 == 2 || c == 18) && j17 != 0 && (j18 != h || i7 != F)) {
                                    j17 = 42;
                                    flag5 = true;
                                }
                                if (j17 <= 'Z' && j17 >= 'A' || j17 >= '0' && j17 <= '9')
                                    C.a(g1, String.valueOf(new char[]{(char) j17}), j9 + k1, j4, 20);
                                else
                                    C.a(g1, "", j9 + k1, j4, 20);
                                System.out.println("stringStartPos: " + j9);
                            }
                            j17 = flag5 ? C.a('*') : C.a(B[i7][j18]);
                            k1 += (j17 != -1 ? C.h[0][j17] : C.b >> 1) + C.m;
                        }

                        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                        if (c != 15) {
                            g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q - 1);
                            g1.setColor(0);
                            g1.drawRect(k14, j4 - 1, i13, P);
                            g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                        }
                        i7++;
                        continue;
                    }
                    String s3;
                    if (a == 0 || a == 54 || a == 9 && (v[l11] == 284 || v[l11] == 0)) {
                        s3 = w[l11];
                    } else {
                        s3 = mainThread.strs[v[l11]];
                        if (z[l11] != null && z[l11].length > 0)
                            s3 = s3 + mainThread.strs[286] + mainThread.strs[z[l11][y[l11]]];
                    }
                    if (l11 == e) {
                        byte byte0;
                        byte byte1;
                        int i16;
                        if (a != 54 && z[l11] != null && z[l11].length > 0) {
                            byte0 = 4;
                            byte1 = 12;
                            i16 = mainThread.Q % 4;
                        } else {
                            byte0 = 12;
                            byte1 = 4;
                            i16 = 0;
                        }
                        String s16;
                        int i18 = cls_b.d(s16 = s3);
                        int l1 = j4 + (C.e(s16) >> 1);
                        as.a(g1, s3, 88, j4, 17);
                        mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - i18 >> 1) - 20 - i16, l1, byte0, 0, 3);
                        mainThread.bK.a(g1, (i18 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20 + i16, l1, byte1, 0, 3);
                    } else {
                        C.a(g1, s3, 88, j4, 17);
                    }
                    if (mainThread.aW && (a == 36 || a == 39) && !mainThread.cq.isEmpty() && (v[l11] == 5 || v[l11] == 45 && mainThread.s(mainThread.ao))) {
                        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                        int j13 = cls_b.c(s3);
                        g1.drawImage(((cls_q) mainThread.K).img104, j13 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1, j4, 20);
                        g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                    }
                }

                g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                if (a == 0) {
                    String s10 = cls_b.a(mainThread.strs[v[e] + 1]);
                    int k13 = mainThread.p.e(s10);
                    int l14 = R + P * (f + 1);
                    int j16 = DeviceInfo.DEVICE_SCREEN_HEIGHT - mainThread.bJ.g - 3;
                    int k17 = l14 + k13 >= j16 ? j16 - k13 : l14;
                    mainThread.p.a(g1, s10, 88, k17, 17);
                }
                return;

            case 8:
                if (an != 0 && an != -1) {
                    String s4;
                    String s6 = s4 = mainThread.strs[an];
                    int k9;
                    if (c == 11 || c == 3)
                        k9 = Math.min((K + 6) / 7 - j, 4);
                    else
                        k9 = Math.min((K + 6) / 7, 4);
                    for (int i2 = 0; i2 < k9; i2++)
                        s4 = s4 + " " + Integer.toString(i2 + j + 1);

                    int j2 = cls_b.c(s4);
                    int i12 = mainThread.img25.getHeight() + 2;
                    C.a(g1, s6, DeviceInfo.DEVICE_SCREEN_WIDTH - j2 >> 1, i12, 20);
                    int l13 = cls_b.d(s6);
                    int i15 = i12 + (C.e(s6) >> 1);
                    for (int k16 = 0; k16 < k9; k16++) {
                        String s17 = " " + Integer.toString(k16 + j + 1);
                        if (i == k16) {
                            as.a(g1, s17, (DeviceInfo.DEVICE_SCREEN_WIDTH - j2 >> 1) + l13, i12, 20);
                            if (k16 + j != 0)
                                mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - j2 >> 1) - 2, i15, 4, 0, 10);
                            boolean flag8 = false;
                            if (c == 11 || c == 3) {
                                if (i != k9 - 1 || i == 3 && (i + j + 1) * 7 < K)
                                    flag8 = true;
                            } else if (i != k9 - 1 || K == 28)
                                flag8 = true;
                            if (flag8)
                                mainThread.bK.a(g1, (j2 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 2, i15, 12, 0, 6);
                        } else {
                            C.a(g1, s17, (DeviceInfo.DEVICE_SCREEN_WIDTH - j2 >> 1) + l13, i12, 20);
                        }
                        l13 += cls_b.c(s17);
                    }

                }
                g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                for (int l5 = g; l5 < g + O; l5++) {
                    if (mainThread.bi[l5] == null) {
                        if (l5 == 0)
                            C.a(g1, mainThread.strs[117], 88, 104, 3);
                        continue;
                    }
                    int j7 = mainThread.bi[l5].getWidth();
                    int l9 = mainThread.bi[l5].getHeight();
                    int k4 = i1 + P * l5 + 14;
                    if (mainThread.aW) {
//                        boolean flag = false;
                        g1.drawImage(mainThread.bi[l5], 143, k4, 3);
                        if (c == 8) {
                            g1.setColor(z[l5][0] != 5 ? 0xed1717 : 0x2bf035);
                            g1.drawRect((143 - (j7 >> 1)) + 1, k4 - (l9 >> 1), j7 - 2, l9);
                            g1.drawRect(143 - (j7 >> 1), (k4 - (l9 >> 1)) + 1, j7, l9 - 2);
                            int k2 = i * 7 + l5;
                            String s11 = x[10][k2].trim();
                            if ((s11).length() > 0) {
                                cls_q q1 = (cls_q) mainThread.K;
                                int l2 = 143 + (q1.img105.getWidth() >> 2);
                                int j15 = k4 - (Math.abs(MainThread.f((int) (MainThread.bP >> 2))) >> 6);
                                g1.drawImage(q1.img105, l2, j15, 36);
                            }
                        } else if (l5 != e) {
                            g1.setColor(0x63a5bd);
                            g1.drawRect((143 - (j7 >> 1)) + 1, k4 - (l9 >> 1), j7 - 2, l9);
                            g1.drawRect(143 - (j7 >> 1), (k4 - (l9 >> 1)) + 1, j7, l9 - 2);
                        }
                        String s1 = w[l5].substring(0, w[l5].indexOf('|'));
                        String s12 = w[l5].substring(w[l5].indexOf('|') + 1);
                        int k15 = 5;
                        int l16 = Math.max(cls_b.c(s1), cls_b.c(s12));
                        g1.setClip(5, 0, 110, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                        if (am)
                            if (t[l5] > 0) {
                                if (--t[l5] == 0)
                                    u[l5] = 0;
                            } else {
                                u[l5]++;
                            }
                        if (l16 > 110) {
                            if (t[l5] == 0 && (5 - u[l5]) + l16 < 115)
                                t[l5] = 5;
                            k15 = 5 - u[l5];
                        }
                        int l17 = c != 7 ? k15 : 5;
                        cls_b b1;
                        (b1 = l5 == e ? as : C).a(g1, s1, l17, k4 + 2, 36);
                        b1.a(g1, s12, k15, (k4 + b1.l) - 3, 36);
                        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                        continue;
                    }
//                    boolean flag1 = false;
                    g1.drawImage(mainThread.bi[l5], 88, k4, 3);
                    if (l5 != e) {
                        g1.setColor(0x63a5bd);
                        g1.drawRect((88 - (j7 >> 1)) + 1, k4 - (l9 >> 1), j7 - 2, l9);
                        g1.drawRect(88 - (j7 >> 1), (k4 - (l9 >> 1)) + 1, j7, l9 - 2);
                    }
                }

                g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                if (mainThread.bi[e] != null) {
                    char c2;
                    if (mainThread.aW)
                        c2 = '\217';
                    else
                        c2 = 'X';
                    g1.setColor(0xf7f700);
                    g1.drawRect(c2 - (mainThread.bi[e].getWidth() >> 1) - 2, i1 + P * e + 1, mainThread.bi[e].getWidth() + 3, mainThread.bi[e].getHeight() + 1);
                    g1.drawRect(c2 - (mainThread.bi[e].getWidth() >> 1) - 1, i1 + P * e, mainThread.bi[e].getWidth() + 1, mainThread.bi[e].getHeight() + 3);
                }
                if (mainThread.aW && c == 3) {
                    for (int i6 = g; i6 < g + O; i6++) {
                        int k7 = i * 7 + i6;
                        if (mainThread.bi[i6] != null && mainThread.s(k7)) {
                            int l4 = i1 + P * i6 + 14;
//                            boolean flag2 = false;
                            g1.drawImage(((cls_q) mainThread.K).img104, 143, l4, 36);
                        }
                    }

                    return;
                }
                break;

            case 2:
            case 3:
                String s5 = mainThread.strs[v[0]];
                if (w != null)
                    s5 = MainThread.a(s5, w);
                String s7 = cls_b.a(s5);
                if (mainThread.sporeInstance.exitImage != null && Spore.e)
                    g1.drawImage(mainThread.sporeInstance.exitImage, 0, 0, 0);
                g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                if (s7.equals("Use Sound?"))
                    g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                C.a(g1, s7, 88 + l, i1, 17);
                if (p) {
                    g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                    C.a(g1, mainThread.strs[235], 88, 204, 33);
                }
                return;

            case 4:
            case 7:
                int ai1[];
                label0:
                {
                    if (fld_b_int == 4 && !al) {
                        int j6 = 0;
                        int l7 = 0;
                        boolean flag6 = false;
                        if (MainThread.bP >= U)
                            flag6 = true;
                        for (int i3 = 0; i3 < v.length; i3++) {
                            int j12 = mainThread.R != 0 ? mainThread.ch[i3] : mainThread.cf[i3];
                            if (mainThread.R == 1 && i3 == 5 || mainThread.R == 0 && i3 == 4)
                                mainThread.ce[i3] = j12;
                            else if (mainThread.ce[i3] < j12) {
                                if (flag6) {
                                    mainThread.ce[i3] = j12;
                                    continue;
                                }
                                mainThread.ce[i3]++;
                                int i14 = 100;
                                do {
                                    if (i14 <= 0)
                                        break;
                                    if (mainThread.ce[i3] + i14 <= j12) {
                                        mainThread.ce[i3] += i14;
                                        break;
                                    }
                                    i14 /= 10;
                                } while (true);
                            }
                            l7 += j12;
                            j6 += mainThread.ce[i3];
                        }

                        if (l7 == j6 || flag6) {
                            al = true;
                            E.b(25);
                        }
                    }
                    ai1 = null;
                    if (fld_b_int == 7) {
                        ai1 = a != 12 ? mainThread.recordManager.fld_m_int_Array : mainThread.recordManager.n;
                        break label0;
                    }
                    if (mainThread.O == 0) {
                        s = 189;
                    } else {
                        if (mainThread.O != 1)
                            break label0;
                        s = 190;
                        if (mainThread.R == 0) {
                            ai1 = mainThread.ch;
                            break label0;
                        }
                    }
                    ai1 = mainThread.ce;
                }
                for (int i8 = 0; i8 < v.length; i8++) {
                    g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
//                    boolean flag3 = false;
                    int i5 = i1 + P * i8;
                    if (fld_b_int == 4) {
                        C.a(g1, mainThread.strs[v[i8]], 22, i5, 20);
                    } else {
                        if (mainThread.aq == i8)
                            as.a(g1, Integer.toString(i8 + 1) + ". ", 22, i5, 20);
                        else
                            C.a(g1, Integer.toString(i8 + 1) + ". ", 22, i5, 20);
                        String s8 = a != 12 ? mainThread.recordManager.o[i8] : mainThread.recordManager.p[i8];
                        int j3 = 154 - cls_b.c("00000") - 3;
                        int k12 = 22 + cls_b.c("00. ");
                        int j14 = cls_b.c(s8);
                        g1.setClip(k12, R, j3 - k12, Q);
                        if (am)
                            if (t[i8] > 0) {
                                if (--t[i8] == 0)
                                    u[i8] = 0;
                            } else {
                                u[i8]++;
                            }
                        if (j14 > j3 - k12) {
                            if (t[i8] == 0 && (k12 - u[i8]) + j14 < j3)
                                t[i8] = 5;
                            k12 -= u[i8];
                        }
                        if (mainThread.aq == i8)
                            as.a(g1, s8, k12, i5, 20);
                        else
                            C.a(g1, s8, k12, i5, 20);
                    }
                    g1.setClip(0, R, DeviceInfo.DEVICE_SCREEN_WIDTH, Q);
                    if (fld_b_int == 4 && (mainThread.R == 0 && i8 == 4 || mainThread.R == 1 && i8 == 5))
                        C.a(g1, mainThread.a((long) ai1[i8]), 154, i5, 24);
                    else if (fld_b_int == 7 && mainThread.aq == i8)
                        as.a(g1, Integer.toString(ai1[i8]), 154, i5, 24);
                    else
                        C.a(g1, Integer.toString(ai1[i8]), 154, i5, 24);
                    g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                }

                return;

            case 6:
                g1.setColor(0x2c3a4c);
                g1.fillRect(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
                g1.drawImage(aq[0], 0, 0, 20);
                for (int k6 = 0; k6 < 6; k6++) {
                    for (int j8 = 0; j8 < 5; j8++) {
                        char c3 = B[k6][j8 << 1];
                        char c1 = B[k6][(j8 << 1) + 1];
                        String s13 = (new Character(c3)).toString();
                        String s14 = (new Character(c1)).toString();
                        if (c == 2 && k6 == H && j8 == G) {
                            if (!p || h % 2 != 0)
                                C.a(g1, s13, ap[j8] + 4, ao[k6], 10);
                            if (!p || h % 2 != 1)
                                C.a(g1, s14, ap[j8] + 4, ao[k6], 6);
                            g1.drawImage(aq[1], ap[j8], ao[k6], 3);
                            continue;
                        }
                        if (c3 != '0' || c1 != '0') {
                            C.a(g1, s13, ap[j8] + 4, ao[k6], 10);
                            C.a(g1, s14, ap[j8] + 4, ao[k6], 6);
                        } else {
                            C.a(g1, ".", ap[j8], ao[k6], 10);
                            C.a(g1, ".", ap[j8], ao[k6], 6);
                        }
                    }

                }

                if (c == 1) {
                    C.a(g1, w[0], 88, DeviceInfo.DEVICE_SCREEN_HEIGHT + ao[5] + 10 >> 1, 3);
                    return;
                }
                break;

            case 1:
                int l6 = aq[e].getWidth();
                int k8 = aq[e].getHeight() + (C.n << 1) + 3;
                int i10 = mainThread.Q % 4;
                int j5 = L + ((M + C.n) - L - k8 >> 1);
                mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - l6 >> 1) - 20 - i10, j5 + (aq[e].getHeight() >> 1), 4, 0, 17);
                g1.drawImage(aq[e], 88, j5, 17);
                mainThread.bK.a(g1, (l6 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20 + i10, j5 + (aq[e].getHeight() >> 1), 12, 0, 17);
                j5 += aq[e].getHeight() + 3;
                g1.setClip(0, j5, DeviceInfo.DEVICE_SCREEN_WIDTH, C.n << 1);
                C.a(g1, mainThread.strs[170 + e], 88, j5, 1);
                return;

            case 10:
                Vector vector = new Vector();
                int l8 = aq[e].getHeight();
                vector.addElement(cls_b.a(mainThread.strs[v[3 * e + 1]]));
                if (mainThread.mgImpl_wap) {
                    if (mainThread.cv[e][0] != null)
                        vector.addElement(cls_b.a(mainThread.strs[263]));
                    if (mainThread.cv[e][1] != null || mainThread.mgImpl_static)
                        vector.addElement(cls_b.a(mainThread.strs[v[3 * e + 2]]));
                } else {
                    vector.addElement(cls_b.a(mainThread.strs[v[3 * e + 2]]));
                }
                for (int j10 = 0; j10 < vector.size(); j10++)
                    l8 += C.e((String) vector.elementAt(j10));

                int k5 = Math.max(L, (L + M) - l8 >> 1);
                int l12 = mainThread.Q % 4;
                int l15 = 0;
                g1.drawImage(aq[e], 88, k5, 17);
                int k3 = aq[e].getHeight();
                if (mainThread.cw > 1) {
                    int k10 = aq[e].getWidth();
                    mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - k10 >> 1) - 20 - l12, k5 + (k3 >> 1), 4, 0, 3);
                    mainThread.bK.a(g1, (k10 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20 + l12, k5 + (k3 >> 1), 12, 0, 3);
                }
                k5 += k3;
                l15++;
                String s15 = (String) vector.elementAt(0);
                C.a(g1, s15, 88, k5, 17);
                k5 += C.e(s15);
                if (mainThread.mgImpl_wap) {
                    if (mainThread.cv[e][0] != null) {
                        l15++;
                        s15 = (String) vector.elementAt(1);
                        int l3 = as.e(s15);
                        if (d == 0) {
                            as.a(g1, s15, 88, k5, 17);
                            int l10 = cls_b.d(s15);
                            mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - l10 >> 1) - 20, k5 + (l3 >> 1), 12, 0, 3);
                            mainThread.bK.a(g1, (l10 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20, k5 + (l3 >> 1), 4, 0, 3);
                        } else {
                            C.a(g1, s15, 88, k5, 17);
                        }
                        k5 += l3;
                    }
                    if (mainThread.cv[e][1] == null && !mainThread.mgImpl_static)
                        break;
                    s15 = (String) vector.elementAt(l15);
                    if (d != 0) {
                        as.a(g1, s15, 88, k5, 17);
                        int i11 = cls_b.d(s15);
                        k5 += as.e(s15) >> 1;
                        mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - i11 >> 1) - 20, k5, 12, 0, 3);
                        mainThread.bK.a(g1, (i11 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20, k5, 4, 0, 3);
                        return;
                    } else {
                        C.a(g1, s15, 88, k5, 17);
                        return;
                    }
                }
                s15 = (String) vector.elementAt(1);
                as.a(g1, s15, 88, k5, 17);
                int j11 = cls_b.d(s15);
                k5 += as.e(s15) >> 1;
                mainThread.bK.a(g1, (DeviceInfo.DEVICE_SCREEN_WIDTH - j11 >> 1) - 20, k5, 12, 0, 3);
                mainThread.bK.a(g1, (j11 + DeviceInfo.DEVICE_SCREEN_WIDTH >> 1) + 20, k5, 4, 0, 3);
                break;
        }
    }

    final void a(int i1) {
        if (fld_b_int != 10)
            e = 0;
        g = 0;
        f = i1;
        P = fld_b_int != 8 ? C.n : Math.max(28, C.n << 1);
        if (fld_b_int == 0 && c == 25)
            P <<= 1;
        L = mainThread.img25.getHeight() + 2;
        if (T != null && fld_b_int != 10)
            L += 37;
        if (an != 0 && fld_b_int != 10)
            if (C.e(cls_b.a(mainThread.strs[an])) > DeviceInfo.DEVICE_SCREEN_HEIGHT - mainThread.img25.getHeight() - mainThread.img24.getHeight() - 3 - P * v.length) {
                L += DeviceInfo.DEVICE_SCREEN_HEIGHT - mainThread.img25.getHeight() - mainThread.img24.getHeight() - 3 - P * v.length;
                u = new int[1];
                t = new byte[1];
            } else if (fld_b_int == 8)
                L += C.e(cls_b.a(mainThread.strs[an])) * 3 >> 1;
            else
                L += C.e(cls_b.a(mainThread.strs[an]));
        M = DeviceInfo.DEVICE_SCREEN_HEIGHT - mainThread.img24.getHeight();
        if (fld_b_int == 0 && c == 22) {
            i1 = 0;
            for (int j1 = 0; j1 < v.length; j1++) {
                int k1;
                if ((k1 = mainThread.p.e(cls_b.a(mainThread.strs[v[j1] + 1]))) > i1)
                    i1 = k1;
            }

            M -= i1;
        }
        if (fld_b_int == 2 || fld_b_int == 3) {
            String si1 = mainThread.strs[v[0]];
            if (w != null)
                si1 = MainThread.a(si1, w);
            f = C.e(cls_b.a(si1)) / P;
        }
        if (fld_b_int != 10) {
            O = (M - L) / P;
            o = f - O <= 0 ? 0 : f - O;
            L += (M - L) % P >> 1;
            M = L + O * P;
            N = Math.max(1, (M - L) / (o + 1));
            O = Math.min(O, f);
            Q = O * P;
        }
        R = L + (M - L - Q >> 1);
    }

    final void a() {
        aq = new Image[A.length];
        ar = new cls_k[A.length];
        for (int i1 = 0; i1 < A.length; i1++) {
            if (A[i1] == null || A[i1][0] == -1)
                continue;
            aq[i1] = MainThread.loadUnencodeImage(A[i1][0]);
            if (A[i1][1] > 1)
                ar[i1] = new cls_k(aq[i1], A[i1][1]);
        }

        if (t != null) {
            for (int j1 = 0; j1 < t.length; j1++)
                t[0] = 5;

        }
        label0:
        switch (fld_b_int) {
            case 5:
            default:
                break;

            case 8:
                i = 0;
                j = 0;
                c();
                break;

            case 6:
                h = 0;
                G = 0;
                H = 0;
                if (c == 0 || c == 1) {
                    if (mainThread.R == 0) {
                        fld_q_short = 5;
                        r = 6;
                    } else {
                        fld_q_short = 6;
                        r = 4;
                    }
                    break;
                }
                fld_q_short = 3;
                if (mainThread.R != 0)
                    r = 4;
                break;

            case 1:
                f = A.length;
                break;

            case 10:
                f = mainThread.cw;
                a(aq[e]);
                break;

            case 4:
                al = false;
                U = MainThread.bP + 8000L;
                break;

            case 7:
                mainThread.recordManager.loadStats(true);
                int k1 = 0;
                do {
                    if (k1 >= 10)
                        break label0;
                    if (mainThread.R == 0) {
                        if (mainThread.recordManager.p[k1].equals(""))
                            mainThread.recordManager.p[k1] = "...";
                    } else if (mainThread.recordManager.o[k1].equals(""))
                        mainThread.recordManager.o[k1] = "...";
                    k1++;
                } while (true);

            case 0:
                if (c == 22) {
                    int l1 = v.length;
                    C = mainThread.w;
                    as = mainThread.x;
                    w = new String[l1];
                    for (int k2 = 0; k2 < l1; k2++)
                        w[k2] = mainThread.strs[v[k2]].toUpperCase();

                    a(l1);
                } else if (c == 20 || c == 21) {
                    int i2 = x[0].length;
                    w = new String[i2];
                    y = new int[i2];
                    for (int l2 = 0; l2 < i2; l2++) {
                        w[l2] = x[1][l2];
                        y[l2] = Integer.parseInt(x[0][l2]);
                    }

                    a(i2);
                }
                if (u == null)
                    break;
                for (int j2 = 0; j2 < u.length; j2++)
                    u[j2] = 0;

                break;

            case 9:
                e = 0;
                F = 0;
                f();
                if (c != 15)
                    break;
                cls_h h1 = this;
                for (int i3 = 0; i3 < h1.B.length; i3++) {
                    if ((new String(h1.B[i3])).trim().length() > 0) {
                        h1.F++;
                        if (h1.F < h1.B.length)
                            continue;
                        h1.F--;
                        break;
                    }
                    if (h1.F <= 0)
                        continue;
                    h1.F--;
                    break;
                }

                h1.h = (new String(h1.B[h1.F])).trim().length();
                if (h1.h >= 15)
                    h1.h--;
                break;

            case 2:
            case 3:
                a(f);
                break;
        }
        g = 0;
        d();
    }

    final void b() {
        for (int i1 = 0; i1 < A.length; i1++) {
            aq[i1] = null;
            ar[i1] = null;
        }

    }

    private void d() {
        if (O < f) {
            if (e == 0) {
                g = 0;
                return;
            }
            if (e == f - 1) {
                g = e - (O - 1);
                return;
            }
            if (e - g > O - 2) {
                g++;
                return;
            }
            if (g > e - 1)
                g--;
        }
    }

    final void b(int i1) {
        switch (fld_b_int) {
            case 5:
            case 6:
            case 9:
            default:
                break;

            case 8:
                if ((i1 & 0x808) != 0) {
                    if (c == 3 || c == 11) {
                        if (i > 0) {
                            i--;
                            c();
                        } else if (j > 0) {
                            i = 3;
                            j -= 4;
                            c();
                        }
                    } else if (i > 0) {
                        i--;
                        c();
                    } else if (j > 0 && mainThread.aW) {
                        i = 3;
                        j -= 4;
                        mainThread.aV = j * 7;
                        mainThread.K.e(n);
                    }
                } else if ((i1 & 0x2010) != 0)
                    if (c == 3 || c == 11) {
                        if (i + j < (K - 1) / 7) {
                            if (i < 3) {
                                i++;
                            } else {
                                i = 0;
                                j += 4;
                            }
                            c();
                        }
                    } else if (i < (K - 1) / 7) {
                        i++;
                        c();
                    } else if (K == 28 && j + i < 998 && mainThread.aW) {
                        i = 0;
                        j += 4;
                        mainThread.aV = j * 7;
                        mainThread.K.e(n);
                    }
                // fall through

            case 0:
                if ((i1 & 0x202) != 0) {
                    if (--e < 0)
                        e = f - 1;
                    d();
                } else if ((i1 & 0x8004) != 0) {
                    e = ++e % f;
                    d();
                } else if (((i1 & 0x2010) != 0 || (i1 & 0x808) != 0) && fld_b_int == 0 && z.length > e && z[e] != null)
                    switch (v[e]) {
                        default:
                            break;

                        case 118:
                            mainThread.recordManager.a = !mainThread.recordManager.a;
                            if (mainThread.recordManager.a) {
                                E.a(mainThread.R != 4 ? 5 : 27, mainThread.R == 4);
                                mainThread.y.b[7].y[0] = 1;
                            } else {
                                if (mainThread.R == 4)
                                    E.b(27);
                                mainThread.y.b[7].y[0] = 0;
                            }
                            mainThread.recordManager.savePrefs();
                            break;

                        case 234:
                            mainThread.recordManager.c = !mainThread.recordManager.c;
                            mainThread.y.b[7].y[1] = mainThread.recordManager.c ? 0 : 1;
                            mainThread.recordManager.savePrefs();
                            break;
                    }
                if (a == 7)
                    if (e == 0 || e == 1) {
                        fld_q_short = 6;
                        return;
                    } else {
                        fld_q_short = 3;
                        return;
                    }
                break;

            case 2:
            case 3:
            case 4:
            case 7:
                if ((i1 & 0x202) != 0) {
                    if (--g < 0) {
                        g = 0;
                        return;
                    }
                    break;
                }
                if ((i1 & 0x8004) != 0 && ++g > o) {
                    g = o;
                    return;
                }
                break;

            case 10:
                if ((i1 & 0x8004) != 0 || (i1 & 0x202) != 0) {
                    d = ++d % 2;
                    if (mainThread.cv[e][0] == null)
                        d = 1;
                    else if (mainThread.cv[e][1] == null && !mainThread.mgImpl_static)
                        d = 0;
                }
                // fall through

            case 1:
                if ((i1 & 0x808) == 0 && (i1 & 0x2010) == 0)
                    break;
                if ((i1 & 0x808) != 0) {
                    if (--e < 0)
                        e = f - 1;
                    d();
                } else if ((i1 & 0x2010) != 0) {
                    e = ++e % f;
                    d();
                }
                i1 = e;
                if (fld_b_int != 10 || mainThread.cw <= 1)
                    break;
                a(aq[e]);
                e = i1;
                if (mainThread.cv[e][0] == null)
                    d = 1;
                else
                    d = 0;
                if (!this.mainThread.mgImpl_static && mainThread.cv[e][0] == null && mainThread.cv[e][1] == null) {
                    this.fld_q_short = 6;
                    return;
                }
                this.fld_q_short = 3;
                break;
        }
    }

    final void c(int i1) {
        if (fld_b_int == 6) {
            if ((i1 & 2) != 0) {
                if (--H < 0)
                    H = 5;
                f();
                return;
            }
            if ((i1 & 4) != 0) {
                H = ++H % 6;
                f();
                return;
            }
            if ((i1 & 8) != 0) {
                if (--G < 0) {
                    G = 4;
                    if (--H < 0)
                        H = 5;
                }
                f();
                return;
            }
            if ((i1 & 0x10) != 0) {
                if (++G == 5) {
                    G = 0;
                    if (++H == 6)
                        H = 0;
                }
                f();
                return;
            }
            if ((i1 & 0x40) != 0) {
                h = G << 1;
                B[H][h] = '0';
                B[H][h + 1] = '0';
                J = -1;
                I = -1;
                ai = MainThread.bP + 2000L;
                return;
            }
        } else {
            if ((i1 & 2) != 0) {
                if (c == 15)
                    return;
                if ((c == 31 || c == 30) && o > 0) {
                    if (--S < 0)
                        S++;
                    return;
                }
                if (--F < 0) {
                    if (F == -1 && z[v.length - 1] != null && v[v.length - 1] != 0 && v[v.length - 1] != -1) {
                        e = v.length - 1;
                        d();
                        return;
                    }
                    F = B.length - 1;
                }
                e = 0;
                for (int j1 = 0; j1 < F;) {
                    if (v[e] == 0 || v[e] == -1)
                        j1++;
                    e++;
                }

                while (e >= v.length || v[e] == 0 || v[e] == -1) {
                    e--;
                }
                d();
                f();
                return;
            }
            if ((i1 & 4) != 0) {
                if (c == 15)
                    return;
                if ((c == 31 || c == 30) && o > 0) {
                    if (++S == (f - O) + 1)
                        S--;
                    return;
                }
                if (++F > B.length - 1) {
                    if (z[v.length - 1] != null && v[v.length - 1] != 0 && v[v.length - 1] != -1) {
                        F = -1;
                        e = v.length - 1;
                    } else {
                        F = 0;
                        e = 0;
                    }
                } else {
                    e = 0;
                    for (int k1 = 0; k1 < F;) {
                        if (v[e] == 0 || v[e] == -1)
                            k1++;
                        e++;
                    }

                    while (e >= v.length || v[e] == 0 || v[e] == -1) {
                        e--;
                    }
                }
                d();
                f();
                return;
            }
            if (F == -1) {
                if ((i1 & 0x10) != 0 || (i1 & 8) != 0) {
                    if ((a == 41 || a == 43) && v[e] == 115) {
                        mainThread.recordManager.K = !mainThread.recordManager.K;
                        y[d] = mainThread.recordManager.K ? 1 : 0;
                        return;
                    }
                } else if ((i1 & 0x40) != 0)
                    mainThread.y.e();
                return;
            }
            if ((i1 & 0x10) != 0) {
                if (B[F][h] != 0)
                    e();
                return;
            }
            if ((i1 & 8) != 0 || (i1 & 0x40) != 0) {
                if (a == 42 && h >= 9)
                    h = 9;
                else if (a == 43 && F == 4 && h >= 15 || a == 9 && F == 0 && h >= 15)
                    h = 15;
                if (B[F][h] == 0 && --h < 0) {
                    boolean flag = true;
                    if (fld_b_int == 9 && c == 15)
                        if (--F < 0) {
                            F = 0;
                        } else {
                            flag = false;
                            h = 15;
                            f();
                        }
                    if (flag) {
                        h = 0;
                        if ((i1 & 0x40) != 0) {
                            mainThread.y.e();
                            return;
                        }
                    }
                }
                B[F][h] = '\0';
                if (fld_b_int == 9 && c == 15 && F > 0) {
                    String s1 = (new String(B[F - 1])).trim();
                    String s2 = (new String(B[F])).trim();
                    if (16 - s1.length() > s2.length()) {
                        B[F - 1][s1.length()] = ' ';
                        char ac2[] = s2.toCharArray();
                        System.arraycopy(ac2, 0, B[F - 1], s1.length() + 1, s2.length());
                        B[F] = new char[16];
                        f();
                    }
                }
                if (a == 42 && (h == 4 || h == 7))
                    B[F][--h] = '\0';
                J = 0;
                I = -1;
                return;
            }
        }
        int l1 = -1;
        switch (i1) {
            case 1048576:
                if (c == 15)
                    l1++;
                else
                    return;
                // fall through

            case 65536:
                l1++;
                // fall through

            case 32768:
                l1++;
                // fall through

            case 16384:
                l1++;
                // fall through

            case 8192:
                l1++;
                // fall through

            case 4096:
                l1++;
                // fall through

            case 2048:
                l1++;
                // fall through

            case 1024:
                l1++;
                // fall through

            case 512:
                l1++;
                // fall through

            case 256:
                l1++;
                // fall through

            case 128:
                l1++;
                break;

            default:
                return;
        }
        if ((l1 == 0 || fld_b_int == 6 && l1 == 1 || i1 != I) && I != -1)
            e();
        ai = MainThread.bP + 2000L;
        J = ++J % mainThread.cd[l1].length;
        if (fld_b_int == 6 && mainThread.cd[l1][J] >= 'a' && mainThread.cd[l1][J] <= 'z')
            J = 0;
        String s3;
        int j2;
        if (fld_b_int == 9 && c == 15 && l1 < 10 && F > 0 && h == 0 && B[F][h] != ' ' && B[F - 1][15] != ' ' && (j2 = (s3 = new String(B[F - 1])).lastIndexOf(' ')) >= 0 && j2 < 15) {
            String s4 = s3.substring(j2 + 1, 16);
            s3 = s3.substring(0, j2 + 1);
            char ac3[] = s4.toCharArray();
            char ac1[] = s3.toCharArray();
            B[F - 1] = new char[16];
            B[F] = new char[16];
            System.arraycopy(ac1, 0, B[F - 1], 0, ac1.length);
            System.arraycopy(ac3, 0, B[F], 0, ac3.length);
            h = B[F].length - 1;
            while (h > 0 && B[F][h - 1] == 0) {
                h--;
            }
        }
        if (fld_b_int == 6) {
            B[H][h] = mainThread.cd[l1][J];
        } else {
            if (a == 42) {
                if (h != 10) {
                    B[F][h] = mainThread.cd[l1][0];
                    d(10);
                }
                return;
            }
            if (l1 >= 0 && a == 43 && F == 4 || a == 9 && F == 0) {
                B[F][h] = mainThread.cd[l1][0];
                e();
                return;
            }
            if (l1 >= 0 && a == 46 && (c == -4 && F == 0 || c == -5 && F == 1)) {
                B[F][h] = mainThread.cd[l1][0];
                e();
                return;
            }
            if (l1 >= 0 && (a == 9 && F == 0 || a == 70)) {
                if (a == 70) {
                    if (h != 10) {
                        B[F][h] = mainThread.cd[l1][0];
                        d(10);
                        return;
                    }
                } else {
                    B[F][h] = mainThread.cd[l1][0];
                    e();
                }
                return;
            }
            if (l1 == 1) {
                int i2;
                if (l1 == 1 && (c == 17 && (F == 0 || F == 1) || c == 16 && (F == 0 || F == 1))) {
                    String s5 = ".-_+1";
                    while (s5.indexOf(mainThread.cd[1][J]) == -1) {
                        J = ++J % mainThread.cd[1].length;
                    }
                    i2 = J;
                } else {
                    i2 = ((J - 1) + mainThread.cd[l1].length) % mainThread.cd[l1].length;
                }
                B[F][h] = mainThread.cd[l1][i2];
            } else {
                B[F][h] = mainThread.cd[l1][J];
            }
        }
        I = i1;
    }

    private void e() {
        d(0);
    }

    private void d(int i1) {
        h++;
        int j1 = -1;
        int k1 = 0;
        do {
            if (k1 >= v.length)
                break;
            if ((v[k1] == 0 || v[k1] == -1) && ++j1 == F) {
                j1 = k1;
                break;
            }
            k1++;
        } while (true);
        if (a == 42 && (h == 4 || h == 7))
            B[F][h++] = '/';
        k1 = i1 - 1;
        if (fld_b_int == 6)
            k1 = 9;
        else if (i1 == 0)
            k1 = v[j1] != 0 ? 63 : 15;
        if (h > k1)
            if (fld_b_int == 6) {
                h = 0;
                H = ++H % 6;
            } else if (c == 15) {
                if (++F > B.length - 1) {
                    F = B.length - 1;
                    h = B[F].length - 1;
                } else {
                    f();
                }
            } else {
                h = k1;
            }
        G = h >> 1;
        J = fld_b_int != 6 ? 0 : -1;
        I = -1;
    }

    private void f() {
        if (F == -1)
            return;
        if (fld_b_int == 6) {
            h = G << 1;
            J = -1;
        } else {
            h = B[F].length - 1;
            while (h > 0 && B[F][h - 1] == 0) {
                h--;
            }
            J = 0;
        }
        p = false;
        aj = MainThread.bP + 300L;
        I = -1;
        ai = MainThread.bP + 2000L;
    }

    private void b(Graphics g1) {
        if (o > 0) {
            int i1 = 168 + l;
            g1.clipRect(0, L, DeviceInfo.DEVICE_SCREEN_WIDTH, (M - L) + 1);
            g1.setColor(k);
            g1.drawRect(i1, L, 4, M - L);
            int j1;
            if (o == g)
                j1 = M - N;
            else
                j1 = L + ((g * (((M - L) << 8) / (o + 1))) >> 8);
            g1.fillRect(i1, j1, 4, N);
            g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        }
    }

    final void a(Image image) {
        T = image;
        a(f);
    }

    final void a(short word0) {
        an = word0;
        a(f);
    }

    final void a(String s1) {
        a(new String[]{
                s1
        });
    }

    final void a(String as1[]) {
        w = new String[as1.length];
        for (int i1 = 0; i1 < as1.length; i1++)
            if (as1[i1] != null)
                w[i1] = as1[i1];
            else
                w[i1] = "null";

    }

    final void a(int i1, String s1, int j1) {
        if (s1 != null) {
            B[i1] = new char[j1];
            System.arraycopy(s1.toCharArray(), 0, B[i1], 0, s1.length());
        }
    }

    final void c() {
//        ac ac1;
        if (mainThread.bi != null)
            (mainThread).bi = null;
        if ((mainThread.aV + x[0].length) / 7 > 999) {
            int i1 = 6993 - mainThread.aV;
            String as1[][] = new String[x.length][];
            for (int j2 = 0; j2 < x.length; j2++) {
                as1[j2] = new String[i1];
                System.arraycopy(x[j2], 0, as1[j2], 0, i1);
            }

            x = new String[as1.length][];
            cls_q.a(as1, x);
        }
        K = x[0].length;
        int j1;
        if (c == 11 || c == 3)
            j1 = (i + j) * 7;
        else
            j1 = i * 7;
        f = Math.min(7, K - j1);
        mainThread.bj = new String[f];
        w = new String[f];
        mainThread.bi = new Image[f];
        mainThread.as = 0;
        if (c == 3 || c == 6 || c == 5 || c == 4 || c == 9 || c == 10 || c == 11) {
            System.arraycopy(x[4], j1, mainThread.bj, 0, f);
            if (mainThread.aW) {
                for (int k2 = 0; k2 < f; k2++) {
                    int k1 = j1 + k2;
                    w[k2] = x[2][k1] + (new Character('|')).toString() + x[3][k1];
                }

            }
        } else if (c == 7) {
            System.arraycopy(x[4], j1, mainThread.bj, 0, f);
            for (int l2 = 0; l2 < f; l2++) {
                int l1 = j1 + l2;
                w[l2] = "#" + x[8][l1] + "." + (new Character('|')).toString() + x[3][l1];
            }

        } else if (c == 8) {
            y = new int[f];
            z = new short[f][];
            for (int i3 = 0; i3 < f; i3++) {
                int i2 = j1 + i3;
                int j3 = Integer.parseInt(x[3][i2]);
                int k3 = Integer.parseInt(x[4][i2]);
                int l3 = Integer.parseInt(x[5][i2]);
                y[i3] = mainThread.K.al != j3 ? j3 : k3;
                mainThread.bj[i3] = x[2][i2];
                w[i3] = mainThread.strs[mainThread.K.al != j3 ? 66 : 65];
                w[i3] += (new Character('|')).toString() + x[0][i2];
                z[i3] = new short[2];
                z[i3][0] = (short) (mainThread.K.al != l3 ? 0 : 5);
                z[i3][1] = (short) (mainThread.K.al != j3 ? 0 : 5);
            }

        }
        if (K > 7 || j > 0) {
            a((short) 36);
            return;
        } else {
            a((short) 0);
            return;
        }
    }
}